﻿using System.Web.Management ;

namespace OpenLightGroup.Common.ApplicationServices
{
    /// <summary>
    /// Used to log debug information to the health monitor providers. Note that 
    /// the EventLogger will not execute the Debug method(s) when complied in a 
    /// non-Debug mode.
    /// </summary>
    /// Both constructors shown below are needed so that the WebEvent API 
    /// can see that this type should be handled as an WebBaseEvent
    /// </remarks>  
    public class DebugEvent
    : WebBaseEvent
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DebugEvent" /> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="eventSource">The event source.</param>
        protected DebugEvent ( string message, object eventSource )
        : base ( "*** DEBUGGING *** : " + message, eventSource, 900000 )
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DebugEvent" /> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="eventSource">The event source.</param>
        /// <param name="eventDetailCode">The event detail code.</param>
        protected DebugEvent ( string message, object eventSource, int eventDetailCode )
            : base("*** DEBUGGING *** : " + message, eventSource, 900000, eventDetailCode)
        {
        }

        ///// <summary>
        ///// Formats the custom event details.
        ///// </summary>
        ///// <param name="formatter">The formatter.</param>
        //public override void FormatCustomEventDetails ( WebEventFormatter formatter )
        //{
        //    base.FormatCustomEventDetails(formatter);
            
        //    //formatter.AppendLine ( "DEBUG INFORMATION:" ) ;
        //}
    }
}